package march.test_3_23;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int[] xArr = new int[n];
        int[] yArr = new int[n];
        for (int i = 0; i < n; i++) {
            xArr[i] = scanner.nextInt();
        }
        for (int i = 0; i < n; i++) {
            yArr[i] = scanner.nextInt();
        }
        int result = 0;
        int cur = -1;
        for (int i = 0; i < n; i++) {
            while (i < n && i - cur < k && xArr[i] >= a && yArr[i] >= b) {
                i++;
            }
            if(i - cur < k) {
                cur = i ;
            }
            if(i - cur == k) {
                cur ++;
                result++;
            }
        }
        System.out.println(result);
    }
}
